<?php
include_once( 'config/config.php' );

function qqauth_autoload( $class_name )
{
	if(strpos($class_name, 'QQAuth') === 0)
	{
		$class_path 			= dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR;
		$class_filename_array 	= explode('_', $class_name);
		$class_filename = strtolower( $class_filename_array[ count( $class_filename_array ) - 1 ] );
		$class_file_path = $class_path . $class_filename . '.php';
	
		if (file_exists( $class_file_path ))
		{
			include_once( $class_file_path );
		}
	}
}

spl_autoload_register('qqauth_autoload');